-- Main library setup
package.name = "Caelum"
package.kind = "dll"
package.language = "c++"
package.files = {
	matchrecursive ("include/*.h"),
	matchrecursive ("src/*.cpp")
}
package.includepaths = {
	"include", 
	"$(OGRE_HOME)/include"
}
package.libpaths = {
	"$(OGRE_HOME)/lib"
}
--package.buildflags = {
--	"extra-warnings", 
--	"fatal-warnings"
--}
-- Debug configuration
package.config["Debug"].target = "caelum_d"
package.config["Debug"].buildflags = {
}
package.config["Debug"].defines = {
	"DEBUG"
}
package.config["Debug"].links = {
	"OgreMain_d",
	"OIS_d"
}
package.config["Debug"].objdir = "../obj/debug"

-- Release configuration
package.config["Release"].target = "caelum"
package.config["Release"].buildflags = {
	"no-symbols", 
	"optimize-speed"
}
package.config["Release"].links = {
	"OgreMain", 
	"OIS"
}
package.config["Release"].objdir = "../obj/release"

-- Precompiled headers; where supported.
package.pchheader = "CaelumPrecompiled.h"
package.pchsource = "CaelumPrecompiled.cpp"

-- Visual Studio extra defines
if target == "vs2005" then
	table.insert (package.config["Debug"].defines, "CAELUM_LIB")
	table.insert (package.config["Release"].defines, "CAELUM_LIB")
end

-- Linux setup
if linux then
	os.copyfile ("../"..project.config["Debug"].bindir.."/lib"..package.config["Debug"].target..".so", "/usr/lib")
	os.copyfile ("../"..project.config["Release"].bindir.."/lib"..package.config["Release"].target..".so", "/usr/lib")
end

